export function copyText(data : string) {
  //#ifndef H5
  uni.setClipboardData({ data });
  //#endif

  // #ifdef H5
  if (document.queryCommandSupported('copy')) {
    const input = document.createElement('input');
    input.value = data;
    input.readOnly = true;
    input.style.height = '1px';
    input.style.opacity = '0';
    document.body.appendChild(input);
    input.select();
    const result = document.execCommand('copy');
    input.remove();
    if (result) {
      uni.showToast({ title: '内容已复制' });
    } else {
      uni.setClipboardData({ data });
    }
  } else {
    uni.setClipboardData({ data });
  }
  // #endif
}
/**
 * 拨号
 */
export function telCall(data : string) {
  uni.makePhoneCall({
    phoneNumber: data,
  });
}
/**
 * 关注公众号
 */
export function follow() {
  window.location.href = 'https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=Mzg4MDY3ODA3MQ==&scene=124#wechat_redirect';
}